package com.s63.ssm.controller;

import com.s63.ssm.entity.Router;
import com.s63.ssm.service.MenuService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/menus")
public class MenuController {
    @Autowired
    private MenuService menuService;

    @GetMapping
    public List<Router> get() {
        return menuService.buildMenu(menuService.getAll());
    }
}
